/**
 * 
 */
package org.istt.service.impl;

import java.util.Date;
import java.util.List;

import org.istt.dao.CategoryDao;
import org.istt.domain.Category;
import org.istt.service.CategoryManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Huy
 *
 */
@Service("categoryManager")
public class CategoryManagerImpl extends ManagerImpl<Category, Long> implements CategoryManager {
	
	/**
	 * @param categoryDao the categoryDao to set
	 */
	@Autowired
	public void setCategoryDao(CategoryDao dao) {
		this.dao = dao;
	}
	
	@Override
	public List<Category> search(Category t, String... excludeProperty) {
		return ((CategoryDao)dao).findByEntity(t, excludeProperty);
	}

	@Override
	public List<Category> getByFieldId(Long fieldId) {
		return ((CategoryDao)dao).findByFieldId(fieldId);
	}

	@Override
	public List<Object[]> statisticsCategory (Long fieldId, Long userId, Date fromDate, Date toDate) {
		return ((CategoryDao)dao).statisticsCategory(fieldId, userId, fromDate, toDate);
	}		

	@Override
	public List<Object[]> getProcessStatusId () {
		return ((CategoryDao)dao).getProcessStatusId();
	}

	@Override
	public List<Category> getByDepartmentId(Long deptID) {
		return ((CategoryDao)dao).findByDeptId(deptID);
	}

	@Override
	public List<Category> getByAllowSubmitOnline() {
		return ((CategoryDao)dao).findByAllowSubmitOnline();
	}

	@Override
	public List<Category> getSortedList() {
		return ((CategoryDao)dao).getSortedList();
	}

}
